1. Field of the Invention
The present invention relates generally to a method of and apparatus for a SCSI repeater to determine the repeater""s input speed, buffer input signals and clean up output signals. More specifically, the present invention pertains to a method to allow a SCSI repeater to dynamically determine the speed of an input signal and output a clean signal at a rate that corresponds to the input signal.
2. Description of the Related Art
As long as there have been computers, users have attached peripheral hardware devices to them. Some of the typical hardware interfaces include Integrated Drive Electronics (IDE) and Enhanced IDE (EIDE) buses. One of the more popular and enduring interfaces is the small computer system interface (SCSI) bus. While an IDE bus is restricted to two disk drives and an EIDE bus is restricted to four devices, including hard disks and CD-ROM drives, the SCSI bus is able to support up to fifteen devices such as disk drives, CD-ROM drives, optical drives, printers, and communication devices. One of the attractions of the SCSI bus is its ability to easily adapt to new types of devices by using a standard set of commands, or the SCSI-3 command set.
The SCSI protocol specifies that communication between an initiator, or device that issues SCSI commands, and a target, a device that executes SCSI commands, takes place in phases: BUS_FREE, ARBITRATION, SELECTION, RE-SELECTION, COMMAND, DATA, MESSAGE_IN, MESSAGE_OUT and STATUS. The first four phases, BUS_FREE, ARBITRATION, SELECTION, and RE-SELECTION, are known collectively as the ADDRESS phases and are used to setup a connection between an initiator and a target device.
The BUS_FREE phase is the initial state and, during the BUS_FREE phase, any SCSI device on a particular SCSI bus can attempt to take control of the bus. Often two or more devices request control at the same time (or within the period of a xe2x80x9cbus settle delayxe2x80x9dxe2x80x94typically 400 ns). Which device gains control is determined in the ARBITRATION phase. After the ARBITRATION phase, the SELECTION phase is performed where the initiator selected in the ARBITRATION phase signals a specific target device that a service is requested. The RE-SELECTION phase is required when an interrupted connection needs to be reestablished.
The final phases, COMMAND, DATA, MESSAGE_IN, MESSAGE_OUT and STATUS, are known collectively as the DATA phases. During the DATA phases, the target device receives commands from the initiator, the two exchange data, and, if necessary, messages and status information are communicated.
If a data transfer is asynchronous, the initiator and the target participate in a handshaking scheme to insure the reliability of the communication. Typically, every data element sent is accompanied by a clock. The target uses the REQ# signal to initiate transfers; the initiator uses an ACK# signal to complete transfers. In the case DATA_IN, or a target sending data to a initiator, the target asserts the REQ# signal to indicate that a byte or word is available and the initiator asserts the ACK# signal to indicate that the byte or word has been received. In the case of DATA_OUT, or a target receiving data from the initiator, the target asserts REQ#, to which the initiator responds by placing data on the bus and asserting ACK#. The target then de-asserts REQ# to acknowledge receipt and the initiator asserts ACK# in response. The handshaking requirements of the SCSI protocol add a large overhead to asynchronous data transfers.
A synchronous data transfer, on the other hand, does not require this element-byelement protocol. During synchronous data transfer, a target does not wait for an individual acknowledgement of each transfer, but rather, employs an xe2x80x9coffset valuexe2x80x9d and transmits that number of REQ#s before requiring an ACK#. The offset is a limit on the number of unacknowledged REQ#s that are allowed before the target must pause and wait for an acknowledgement from the initiator. The data in asynchronous transactions is clocked by the sender""s REQ# or ACK# line.
To maximize performance, a SCSI bus should not exceed a predetermined length. For example, the predetermined length can be exceeded when a server, located in one box or unit, is connected through a SCSI bus to a mass storage subsystem, such as a disk drive array or a CD-ROM drive located in another box or unit. To prevent performance degradation, designers have implemented what is known as repeater circuits. Repeater circuits are used to couple short, terminated SCSI bus segments. The repeater circuit includes two ports with each port connected to a different terminated SCSI bus segment. The repeater circuit provides a buffer between the terminated bus segments in order to achieve a high performance SCSI bus that exceeds the predetermined length. To a SCSI controller, the terminated bus segments appear as a single SCSI bus.
The present invention relates to the determination of a data rate on a SCSI repeater. Typically, repeaters simply buffer SCSI signals; they do not improve the quality of the signal. The SCSI interface is extremely flexible; it is used to attach many different types of devices such as optical scanners, disk drives, tape drives, and CD-ROM drives to a computer some of which may need to be located at a distance from the computer. The method of and apparatus for the present invention determines the speed of SCSI input so that the output can be xe2x80x9csquared upxe2x80x9d and the duty cycle restored. Squaring up the signal improves the quality of the signal.
The method of and apparatus for the present invention determine the synchronous data rate of the input bus during a SCSI data phase and, depending upon whether a Linear Rate function is selected, either matches the output clock speed to the input clock speed or snaps the output bus speed to the closest standard SCSI data rate.
When the Linear Rate function is not selected, the incoming data is classified into one of the following categories: asynchronous, synchronous-10, synchronous-20, or synchronous-40. The categorized rate can increase during a data transfer but it may not decrease. In other words, data may transfer at a negotiated rate or less, increasing during the transfer up to the negotiated rate. The rate of the output is determined by the rate of the input. All non-data phases are classified as asynchronous.
When the Linear Rate function is selected, the output SCSI clock tracks the input SCSI clock period in resolutions of two 240 MHz clock periods. There is a xe2x80x9csnappingxe2x80x9d effect around the standard rates of 5, 10, 20 and 40 MHz. For example, an input clock rate of 5.1 MHz may map to 5 MHz but an input rate of 6.1 MHz maps to an output clock rate of 6.1 MHz.